package com.wjv.example.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * <p>Title: ApplicationContextConfig</p>
 * <p>Company:misspao </p>
 *
 * @author: wjv
 * @Date: Create in 15:13 2020/9/22
 * @Description:
 */
@Configuration
public class ApplicationContextConfig {

    /** 使 RestTemplate bean 被配置为使用 LoadBalancerClient */
    @LoadBalanced
    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
